package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.CustomTemplateFieldAddDTO;
import org.jsola.hr.dto.CustomTemplateFieldBatchDTO;
import org.jsola.hr.dto.CustomTemplateFieldUpdateDTO;
import org.jsola.hr.query.CustomTemplateFieldQuery;
import org.jsola.hr.vo.CustomFieldVO;
import org.jsola.hr.vo.CustomTemplateFieldListVO;
import org.jsola.hr.vo.CustomTemplateFieldVO;

import java.util.List;

/**
 * 自定义模板字段
 *
 * @author zhr
 */
@Api(tags = "hr-自定义模板字段")
public interface ICustomTemplateFieldControllerAPI {

    /**
     * 查询所有的员工设置字段和入职模板字段
     *
     * @param companyId 用工单位Id
     * @return 字段集合
     */
    @ApiOperation(value = "查询所有的员工设置字段和入职模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "用工单位Id", paramType = "path")
    })
    Result<List<String>> selectAllEmpFiled(String companyId);

    /**
     * 新增自定义模板字段
     *
     * @param customTemplateFieldAddDTO 自定义模板字段新增实体
     * @return 自定义模板字段展示对象
     */
    @ApiOperation(value = "新增自定义模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldAddDTO", dataType = "CustomTemplateFieldAddDTO", value = "新增自定义模板字段", paramType = "body")
    })
    Result<CustomTemplateFieldVO> save(CustomTemplateFieldAddDTO customTemplateFieldAddDTO);


    /**
     * 修改自定义模板字段
     *
     * @param customTemplateFieldUpdateDTO 自定义模板字段
     * @return 更新数量
     */
    @ApiOperation(value = "修改自定义模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldUpdateDTO", dataType = "CustomTemplateFieldUpdateDTO", value = "修改自定义模板字段", paramType = "body")
    })
    Result<Integer> update(CustomTemplateFieldUpdateDTO customTemplateFieldUpdateDTO);

    /**
     * 批量编辑、新增、删除自定义模板字段
     *
     * @param customTemplateFieldBatchDTO 要操作的自定义模板字段
     * @return 操作之后的全部自定义模板字段
     */
    @ApiOperation(value = "批量编辑、新增、删除自定义模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldBatchDTO", dataType = "CustomTemplateFieldBatchDTO", value = "要操作的字段数据", paramType = "body")
    })
    Result batch(CustomTemplateFieldBatchDTO customTemplateFieldBatchDTO);


    /**
     * 删除单个自定义模板字段，彻底删除
     *
     * @param customTemplateFieldId 自定义模板字段id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个自定义模板字段，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldId", dataType = "String", value = "自定义模板字段id", paramType = "path")
    })
    Result<Integer> delete(String customTemplateFieldId);


    /**
     * 批量删除自定义模板字段，彻底删除
     *
     * @param customTemplateFieldIds 自定义模板字段id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除自定义模板字段，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldIds", dataType = "String[]", value = "自定义模板字段id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] customTemplateFieldIds);


    /**
     * 根据自定义模板字段id查询自定义模板字段详情
     *
     * @param customTemplateFieldId 自定义模板字段id
     * @return 自定义模板字段详情
     */
    @ApiOperation(value = "根据自定义模板字段id查询自定义模板字段详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldId", dataType = "String", value = "自定义模板字段id", paramType = "path")
    })
    Result<CustomTemplateFieldVO> findById(String customTemplateFieldId);


    /**
     * 查询自定义模板字段
     *
     * @param customTemplateFieldQuery 自定义模板字段查询参数
     * @return page
     */
    @ApiOperation(value = "查询自定义模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldQuery", dataType = "CustomTemplateFieldQuery", value = "自定义模板字段查询参数", paramType = "query")
    })
    Result<List<CustomTemplateFieldListVO>> listAll(CustomTemplateFieldQuery customTemplateFieldQuery);

    /**
     * 查询系统字段+自定义字段
     *
     * @param customTemplateFieldQuery 自定义模板字段查询参数
     * @return page
     */
    @ApiOperation(value = "查询系统字段+自定义字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldQuery", dataType = "CustomTemplateFieldQuery", value = "自定义模板字段查询参数", paramType = "query")
    })
    Result<CustomFieldVO> selectAllField(CustomTemplateFieldQuery customTemplateFieldQuery);


    /**
     * 分页查询自定义模板字段
     *
     * @param customTemplateFieldQuery 自定义模板字段查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询自定义模板字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldQuery", dataType = "CustomTemplateFieldQuery", value = "自定义模板字段查询参数", paramType = "query")
    })
    Result<Page<CustomTemplateFieldListVO>> page(CustomTemplateFieldQuery customTemplateFieldQuery);


    /**
     * 查询系统默认字段
     *
     * @param customTemplateFieldQuery 自定义模板字段查询参数
     * @return 自定义模板字段列表
     */
    @ApiOperation(value = "查询系统默认字段")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customTemplateFieldQuery", dataType = "CustomTemplateFieldQuery", value = "自定义模板字段查询参数", paramType = "query")
    })
    Result<CustomFieldVO> listDefaultField(CustomTemplateFieldQuery customTemplateFieldQuery);


}

